package com.fs.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fs.entity.ResponseData;
import com.fs.entity.Reviewers;
import com.fs.entity.ReviewersCondition;
import com.fs.entity.ReviewersShow;
import com.fs.service.IAdministratorsService;
import org.apache.ibatis.annotations.Update;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2024-06-12
 */
@RestController
@RequestMapping("/administrators")
public class AdministratorsController {
    @Autowired
    private IAdministratorsService administratorsService;
    @PostMapping("login")

    public ResponseData Login(String acount, String apassword){
        return administratorsService.Login(acount,apassword);
    }


    @PutMapping("/update")
    public ResponseData Update(int aid, String newapassword, String newaphnumber, String newemail){
        return administratorsService.Update(newapassword,newaphnumber,newemail,aid);
    }
    @PostMapping("spot")
    public ResponseData spotcheck(){
        return administratorsService.Spotcheck();
    }
    @PostMapping("departcheck")
    public ResponseData DepartCheck(int ReqCredit){
        return administratorsService.CheckIndepart(ReqCredit);
    }
    @PostMapping("classCheck")
    public ResponseData ClassCheck(int ReqCredit){
        return administratorsService.CheckClass(ReqCredit);
    }
    @PostMapping("warm")
    public ResponseData Warm(int Credit){
        return administratorsService.Warm(Credit);
    }
    @PostMapping("checkClassM")
    public ResponseData CheckClass(int classname){
        return administratorsService.CheckallmaterialsInclass(classname);
    }
    @PostMapping("CheckReviewers")
    public ResponseData CheckReviewers(){
        return administratorsService.ShowReviewers();
    }
    @PostMapping("urge")
    public ResponseData Urge(int rid[]){
        return administratorsService.urge(rid);
    }

    @GetMapping("PageByReviewers")
    public Page<ReviewersShow> PageForRew(ReviewersCondition condition){
        return administratorsService.SelectReviwersBynameAndid(condition);
    }

}
